import { log } from "mathjs";

import { defineStore } from "pinia";


export const contractOptions = defineStore({
    id: "contractOptions",
    state: (): contractOptions => ({
        org_structure: {//组织架构数据

        }
        , job_nature: []//工作性质
        , status: []//合同状态status
        , contract_company_id: []//合同签署公司
        , isUpata: false
    }),
    getters: {
        getData: (state) => {//返回数据
        
            return {
                org_structure: state.org_structure,
                job_nature: state.job_nature,
                contract_company_id: state.org_structure,
                contract_type: state.contract_type,
                status: state.status,
            }
        },
        getStatus:(state)=>{
          return state.isUpata
        }
    },
    actions:{
        setData(data){ 
            this.org_structure= {...this.org_structure,...data.orgs};
            this.job_nature= {...this.job_nature,...data.job_nature};
            this.contract_company_id= {...this.contract_company_id,...data.contract_company_id};
            this.contract_type= {...this.contract_type,...data.contract_type};
            this.status= {...this.status,...data.status};

        },
        setStatus(value){
          this.isUpata=value;
      
        }
    }
})

